
package com.doc2video.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.doc2video.common.Result;
import com.doc2video.dto.DocumentUploadDTO;
import com.doc2video.entity.Document;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * 文档Service接口
 */
public interface DocumentService extends IService<Document> {

    /**
     * 上传文档
     */
    Result<Document> uploadDocument(DocumentUploadDTO uploadDTO, HttpServletRequest request);

    /**
     * 分页查询用户文档列表
     */
    Result<Page<Document>> getUserDocuments(Page<Document> page, HttpServletRequest request);

    /**
     * 根据ID查询文档
     */
    Result<Document> getDocumentById(Long id, HttpServletRequest request);

    /**
     * 删除文档
     */
    Result<String> deleteDocument(Long id, HttpServletRequest request);

    /**
     * 提取文档内容
     */
    Result<String> extractDocumentContent(Long documentId);

    /**
     * 下载文档
     */
    Result<byte[]> downloadDocument(Long id, HttpServletRequest request);
}
